package ren.yugong.fileutil.template;

import ren.yugong.fileutil.TxtTemplate;
import ren.yugong.fileutil.TxtTemplateColumn;

import java.util.Objects;

@TxtTemplate
public class Demo4Template {

    @TxtTemplateColumn(order = 1, length = 4)
    private String column1;

    @TxtTemplateColumn(order = 2, length = 5)
    private String column2;

    public String getColumn1() {
        return column1;
    }

    public void setColumn1(String column1) {
        this.column1 = column1;
    }

    public String getColumn2() {
        return column2;
    }

    public void setColumn2(String column2) {
        this.column2 = column2;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Demo4Template that = (Demo4Template) o;

        if (!Objects.equals(column1, that.column1)) return false;
        return Objects.equals(column2, that.column2);
    }

    @Override
    public int hashCode() {
        int result = column1 != null ? column1.hashCode() : 0;
        result = 31 * result + (column2 != null ? column2.hashCode() : 0);
        return result;
    }
}
